package com.wrx.redis_learning.utils;

import java.util.Random;

public class VerifyCode {
    public static String generateCode(int len){
        String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random = new Random();
        StringBuilder code = new StringBuilder(len);

        for (int i = 0; i < len; i++) {
            code.append(characters.charAt(random.nextInt(characters.length())));
        }

        return code.toString();
    }
}
